<div id = "userPanel">
    <?php
    if ($this->identity){
        echo "你好，<a href = '/user/account/id/".$this->identity->id."'>".$this->identity->username."</a>，欢迎登录！".
        "<a href = '/user/logout'>注销</a> ｜ ".
        "<a href = '/user/change-password/id/".$this->identity->id."''>更改密码</a>";
        if ($this->identity->role === 'admin') {
            echo " ｜ <a href = '/admin/home' target='_blank'>后台管理</a>";
        }
    } else{
        echo "<a href = '/user/login'>登录</a><a href='/user/register'>注册</a><a href='/user/reset-password'>忘记密码？</a>";
        
    }
    ?>
</div>